<?php
namespace app\common\validate;
class Article extends \think\Validate
{
    protected $rule = [
        'title'  => 'require',
        'img' => 'require',
        'text'   => 'require',
        'target' => 'require',
    ];
    protected $message = [
        'title.require' => '标题不能为空',
        'img.require' => '图片不能为空',
        'text.unique' => '文本文件不能为空',
        'target.require' => '目标对象不为空',
    ];

    protected $scene = [
        'upload'  =>  ['title','img','text','target'],
        'update' => ['title','text','target']
    ];


}